#ifndef FS_H_
#define FS_H_

#define MAX_LEN_NAME 30
#define DEEP 6//30
#define MAX_INODE 10//100
#define MAX_LEN_FILE 100
#define MAX_DIRS MAX_INODE/2
#define MAX_FILES MAX_DIRS

/*defino los tipos de inodos*/
#define EMPTY -1
#define DIR 0
#define FILE 1

typedef struct{
	int type;
	int source;
	char name [MAX_LEN_NAME];
	int prev_dir;//index which points to the previous directory in the previous column
	int next_dirs [MAX_DIRS];//indexes which point to the next directories in the next column
	int next_files [MAX_FILES];
	char file_dir[MAX_LEN_FILE];
}inode;

void init_fs(inode ** fs);
void initPath(int* path);
int mkdir(inode **fs,int path [], char dir_name []);
void create_dir(char name [],inode **fs,int i,int j,int prev_d);
	void copy_name(char dest[],char orig[]);
void print_path(inode ** fs, int path []);
void cd(inode **fs ,int path [], char dir_name []);
	int cmp_str(char s1 [],char s2 []);
	int isDirValid(inode **fs ,int path [], char dir_name []);
	int last_dir_col(int path []);
void ls(inode **fs, int path []);
	int dirExists(inode **fs,int path [], char dir_name []);
int rmdir(inode **fs,int path [], char dir_name []);
void creat(inode **fs ,int path [], char file_name [],char file []);
int filExists(inode **fs,int path [], char file_name []);
	void cp(char dest[],char orig[]);
int cat(inode **fs,int path [], char file_name []);
void rm(inode **fs ,int path [], char file_name []);
void find(inode **fs, int path[], char* file_name,int recursive);
int rename(inode **fs, int path[], char* file_name, char * newfilename);
int renamedir(inode **fs, int path[], char* dir_name, char * newdir_name);

#endif /*FS_H_*/
